// 注册
let registerUrl = 'register'
// 登录
let autoLoginUrl = 'auto-login'
// 用户中心获取
let userCenterUrl = 'user/center'
// 设置收货地址
let addressUrl = 'user/order-address'
// 商户申请
let merchantApplyUrl = 'merchant/apply'
// 学校列表
let schoolsListUrl = 'schools'
// 店铺列表
let shopListUrl = 'default-merchant'
// 店铺分类
let categoryUrl = 'category'
// 店铺商品list
let goodsListUrl = 'goods/list'
// 店铺商品详情
let goodsDetailUrl = 'goods/detail'
// 设置购物车
let setCarUrl = 'goods-car/set'
// 获取购物车数据
let getCarDataUrl = 'goods-car/info'
// 订单提交
let orderSubmitUrl = 'order/submit'
// 订单列表
let orderListUrl = 'order/list'
// 订单收获
let confirmOrderUrl = 'order/confirm'
// 楼长分类
let builderCategoryUrl = 'merchant/category'
// 楼长商品列表
let builderGoodsListUrl = 'merchant/goods-list'
// 订单支付
let orderPayUrl = 'order/pay'
// 订单支付状态
let orderPayStatusUrl = 'order/is-pay'
// 店铺设置
let shopSeytingUrl = 'merchant/setting'
// 进货下单
let jinhuoUrl = 'merchant/submit-order'
// 钱包支付
let yuePayUrl = 'merchant/order-wallet-pay'
// 微信支付
let wxPayUrl = 'merchant/order-pay'
// 楼长进货list
let builderJInhuoUrl = 'merchant/order-list'
// 楼长进货订单收货
let builderOrderConfirmUrl = 'merchant/order-confirm'
// 用户订单
let userOrderUrl = 'merchant/users/order'
// 用户订单发货
let userOrderFahuoUrl = 'merchant/users/order/delivery'
// 进货方式list
let jinhuoMethodUrl = 'merchant/packages'
// 仓库信息
let warehouseInfoUrl = 'merchant/warehouse-info'
// 申请提现
let withDrawApplyUrl = 'merchant/withdraw/apply'
// 钱包详情
let walletInfoUrl = 'merchant/wallet/info'
// 钱包明细
let walletTransactionUrl = 'merchant/wallet/transaction'
// 商户信息
let merchantInfoUrl = 'merchant-info'
// 店铺二维码
let merchantQrcodeUrl = 'merchant/wx-code'
// 审核问题
let systemUrl = 'system'
// 申请退款
let orderRefundUrl = 'merchant/order-refund'

const install = (Vue, vm) => {
  //注册
  let registerApi = (params) => vm.$u.post(registerUrl, params);
  //登录
  let autoLoginApi = (params) => vm.$u.post(autoLoginUrl, params);
  // 用户中心获取
  let userCenterApi = (params) => vm.$u.get(userCenterUrl, params);
  // 设置收货地址
  let addressApi = (params) => vm.$u.post(addressUrl, params);
  // 商户申请
  let merchantApplyApi = (params) => vm.$u.post(merchantApplyUrl, params);
  // 学校列表
  let schoolsListUApi = (params) => vm.$u.get(schoolsListUrl, params);
  // 店铺列表
  let shopListApi = (params) => vm.$u.get(shopListUrl, params);
  // 店铺分类
  let categoryApi = (params) => vm.$u.get(categoryUrl, params);
  // 店铺商品list
  let goodsListApi = (params) => vm.$u.get(goodsListUrl, params);
  // 店铺商品详情
  let goodsDetailAapi = (params) => vm.$u.get(goodsDetailUrl, params);
  // 设置购物车
  let setCarApi = (params) => vm.$u.post(setCarUrl, params);
  // 获取购物车数据
  let getCarDataApi = (params) => vm.$u.get(getCarDataUrl, params);
  // 订单提交
  let orderSubmitApi = (params) => vm.$u.post(orderSubmitUrl, params);
  // 订单列表
  let orderListApi = (params) => vm.$u.get(orderListUrl, params);
  // 订单收获
  let confirmOrderApi = (params) => vm.$u.post(confirmOrderUrl, params);
  // 楼长分类
  let builderCategoryApi = (params) => vm.$u.get(builderCategoryUrl, params);
  // 楼长商品列表
  let builderGoodsListApi = (params) => vm.$u.get(builderGoodsListUrl, params);
  // 订单支付
  let orderPayApi = (params) => vm.$u.post(orderPayUrl, params);
  // 订单支付状态
  let orderPayStatusApi = (params) => vm.$u.get(orderPayStatusUrl, params);
  // 店铺设置
  let shopSeytingApi = (params) => vm.$u.post(shopSeytingUrl, params);
  // 进货下单
  let jinhuoApi = (params) => vm.$u.post(jinhuoUrl, params);
  // 钱包支付
  let yuePayApi = (params) => vm.$u.post(yuePayUrl, params);
  // 微信支付
  let wxPayApi = (params) => vm.$u.post(wxPayUrl, params);
  // 楼长进货list
  let builderJInhuoApi = (params) => vm.$u.get(builderJInhuoUrl, params);
  // 楼长进货订单收货
  let builderOrderConfirmApi = (params) => vm.$u.post(builderOrderConfirmUrl, params);
  // 用户订单
  let userOrderApi = (params) => vm.$u.get(userOrderUrl, params);
  // 进货方式list
  let jinhuoMethodApi = (params) => vm.$u.get(jinhuoMethodUrl, params);
  // 仓库信息
  let warehouseInfoApi = (params) => vm.$u.get(warehouseInfoUrl, params);
  // 用户订单发货
  let userOrderFahuoApi = (params) => vm.$u.post(userOrderFahuoUrl, params);
  // 申请提现
  let withDrawApplyApi = (params) => vm.$u.post(withDrawApplyUrl, params);
  // 钱包详情
  let walletInfoApi = (params) => vm.$u.get(walletInfoUrl, params);
  // 钱包明细
  let walletTransactionApi = (params) => vm.$u.get(walletTransactionUrl, params);
  // 审核问题
  let systemApi = (params) => vm.$u.get(systemUrl, params);
  // 申请退款
  let orderRefundApi = (params) => vm.$u.post(orderRefundUrl, params);
  // 商户信息
  let merchantInfoApi = (params) => vm.$u.get(merchantInfoUrl, params);
  // 商户信息
  let merchantQrcodeApi = (params) => vm.$u.get(merchantQrcodeUrl, params);
  
  vm.$u.api = {
    registerApi,
    autoLoginApi,
    userCenterApi,
    addressApi,
    merchantApplyApi,
    schoolsListUApi,
    shopListApi,
    categoryApi,
    goodsListApi,
    goodsDetailAapi,
    setCarApi,
    getCarDataApi,
    orderSubmitApi,
    orderListApi,
    confirmOrderApi,
    builderCategoryApi,
    builderGoodsListApi,
    orderPayApi,
    orderPayStatusApi,
    shopSeytingApi,
    jinhuoApi,
    yuePayApi,
    wxPayApi,
    builderJInhuoApi,
    builderOrderConfirmApi,
    userOrderApi,
    jinhuoMethodApi,
    warehouseInfoApi,
    userOrderFahuoApi,
    withDrawApplyApi,
    walletInfoApi,
    walletTransactionApi,
    systemApi,
    orderRefundApi,
    merchantInfoApi,
    merchantQrcodeApi
  };
}

export default {
  install
}